/*
 * @(#)cn.design.pattern.command 2020/4/23/0023
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.command;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/23/0023
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class Client {
	public static void main(String[] args) {
		LightReceiver lightReceiver = new LightReceiver();
		LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver);
		LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver);
		RemoteController remoteController = new RemoteController();
		remoteController.setCommand(0, lightOnCommand, lightOffCommand);
		System.out.println("-------按下灯的开始钮---------");
		remoteController.onButtonWasPushed(0);
		System.out.println("-------按下灯的关始钮---------");
		remoteController.offButtonWasPushed(0);
		System.out.println("-------按下撤销按钮-----------");
		remoteController.undoButtonWasPushed();
	}
}
